//
//  WebViewController.m
//  VideoTest
//
//  Created by lanou3g on 15/5/29.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//


#import "WebViewController.h"


@interface WebViewController ()

@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
// Do any additional setup after loading the view from its nib.
    
    [self loadIndicatorView];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc ]initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(didClickClose)];
    self.VideoWebView.delegate = self;
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.Url]];
    [self.VideoWebView loadRequest:request];
    
}


- (void)didClickClose{
    [self dismissViewControllerAnimated:YES completion:nil];
    return ;
}

#pragma -----初始就加载indicatorView
- (void)loadIndicatorView{
    [self.view bringSubviewToFront:self.VideoIndicator];
    self.VideoIndicator.transform = CGAffineTransformMakeScale(3.0, 3.0);
    self.VideoIndicator.color = [UIColor blackColor];
    [self.VideoIndicator startAnimating];
    CGPoint center = [UIApplication sharedApplication].keyWindow.center;
    NSLog(@"%@",NSStringFromCGPoint(center));
    [self.VideoIndicator hidesWhenStopped];
     self.VideoIndicator.hidden =NO;
    return ;
}

#pragma ---实现UIWebView代理方法
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [self.VideoIndicator stopAnimating];
    self.VideoIndicator.hidden = YES;
    return ;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
